import 'package:citiesocial/_include.dart';

///
///单个商品的组件，长方行的，但图片是方的，比如用到历史查看商品
///
class GoodsInOrderDetail extends StatelessWidget {
  final GoodsEntity goods;

  GoodsInOrderDetail(this.goods);

  @override
  Widget build(BuildContext context) => Container(
        child: Column(
          children: <Widget>[
            Row(
              children: <Widget>[
                Container(
                  margin: EdgeInsets.only(left: 10.0),
                  child: Image(
                    image: CachedNetworkImageProvider(
                      '${goods.goods_img}',
                    ),
                    height: 100.0,
                    width: 100.0,
                    fit: BoxFit.cover,
                  ),
                ),
                Expanded(
                  child: Container(
                    height: 100.0,
                    color: Colors.white,
                    padding: EdgeInsets.symmetric(horizontal: 15.0),
                    child: Column(
                      crossAxisAlignment: CrossAxisAlignment.start,
                      mainAxisAlignment: MainAxisAlignment.center,
                      children: <Widget>[
                        Text(
                          '${goods.goods_name}',
                          style: TextStyle(
                            color: Colors.grey,
                            fontSize: 14.0,
                          ),
                          maxLines: 1,
                        ),
                        Text(
                          '${goods.goods_price}  x${goods.goods_number}',
                          style: TextStyle(
                            color: Colors.black54,
                            fontSize: 15.0,
                          ),
                          maxLines: 1,
                        ),
                      ],
                    ),
                  ),
                ),
              ],
            ),
            Configs.dividerLine
          ],
        ),
        color: Colors.white,
      );
}
